// 文件位置: src/main/java/com/pharmacy/SaleManage/dao/OperationLogMapper.java
package com.pharmacy.SaleManage.dao;

import com.pharmacy.SaleManage.entity.SaleRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface SaleRecordMapper {
    List<SaleRecord> findAllSaleRecords();
    SaleRecord findSaleRecordById(Integer id);
    List<SaleRecord> findSaleRecordsByDateRange(@Param("startDate") Date startDate, @Param("endDate") Date endDate);
    List<SaleRecord> findSaleRecordsByMedicineId(Integer medicineId);
    List<SaleRecord> findSaleRecordsByOperatorId(Integer operatorId);
    int insertSaleRecord(SaleRecord saleRecord);
    Double getTotalSalesByDateRange(@Param("startDate") Date startDate, @Param("endDate") Date endDate);
}